using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TalentPanel : BasePanel
{
    static readonly string path = "UI/Panel/TalentPanel";
    public TalentPanel() : base(new UIType(path)) { }
    public override void OnEnter()
    {
        uitool.GetOrAddComponentInChildren<Button>("return").onClick.AddListener(() =>
        {
            panelmanager.Pop();
        });
        uitool.GetOrAddComponentInChildren<Button>("refresh").onClick.AddListener(() =>
        {
            if (PlayerData.talentchangetimes > 0)
            {
                TalentData.NewTalents();
                PlayerData.talentchangetimes--;
                panelmanager.PopAndPush(new TalentPanel());
            }
            
        });
    }
}
